﻿@model IEnumerable<JuniorProject.Models.SearchModel>

@{
    ViewBag.Title = "Search";
}

@section scripts
{
    <link href="@Url.Content("~/Content/themes/base/jquery-tablesorter.css")" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery.tablesorter.js")" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
            $('table').tablesorter({ headers: { 4: { sorter: false} }, sortList: [[0, 0]] });
        });
    </script>
}

<h2>
Job Postings
</h2>
<br />


<p>
    @using (Html.BeginForm("SearchJobs","Search",FormMethod.Get)){     
        <p>Seach: @Html.TextBox("SearchStr")   
        <input type="submit" value="Go" /></p> 
    } 
</p>

<table id="table" class="tablesorter">
    <thead>
    <tr>
        <th>
            @Html.DisplayNameFor(model => model.Title)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Location)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.InsertDate)
        </th>
    </tr>
    </thead>

    <tbody>
@foreach (var item in Model) {
    <tr>
        <td>
            @Html.ActionLink(item.Title, "Details", new { id=item.PostingID })
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Location)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.InsertDate.Month).
            @Html.DisplayFor(modelItem => item.InsertDate.Day).
            @Html.DisplayFor(modelItem => item.InsertDate.Year)
        </td>
    </tr>
}
    </tbody>
</table>
<br />
@Html.ActionLink("Back", "Index", "Home")
